package study.mq.rocketmq.consumer.consumer;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * 消费者
 * （1）并发
 * （2）顺序
 */
@Slf4j
@Component
@RocketMQMessageListener(topic = "consume_topic",
        consumerGroup = "consume_group",
        consumeMode = ConsumeMode.CONCURRENTLY)
public class _04_ConsumeModeConsumer implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        log.info("");
        log.info(">>>>>> = {}", message);
        log.info("");
    }
}
